package me.youline.dataServer.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import me.youline.dataServer.service.support.file.FileBuilder.FileEntity;

/**
 * AR内容数据实体
 * @author linhan
 *
 */
@Entity
@Table(name="yline_resource_ar_content")
public class ArContentEntity implements Serializable{
	

	private static final long serialVersionUID = -3405934660926883402L;

	/**
	 * ID
	 */
	@Id
	@GeneratedValue
	private Long id;
	
	@Column
	private Long arSceneId;
	
	@Column
	private  String contentUrl;
	
	@Column
	private String recognPicUrl;
	
	@Column
	private Long creatorId;
	
	@Column
	private long contentSize;
	
	@Column
	private String displayPicUrl;
	
	@Column
	private boolean isDefaultVoice;
	
	@Column
	private boolean isDefaultText;
	
	@Column
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTime;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getArSceneId() {
		return arSceneId;
	}

	public void setArSceneId(Long arSceneId) {
		this.arSceneId = arSceneId;
	}

	public String getContentUrl() {
		return contentUrl;
	}

	public void setContentUrl(String contentUrl) {
		this.contentUrl = contentUrl;
	}

	public Long getCreatorId() {
		return creatorId;
	}

	public void setCreatorId(Long creatorId) {
		this.creatorId = creatorId;
	}

	public long getContentSize() {
		return contentSize;
	}

	public void setContentSize(long contentSize) {
		this.contentSize = contentSize;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getRecognPicUrl() {
		return FileEntity.decodePath(recognPicUrl);
	}

	public void setRecognPicUrl(String recognPicUrl) {
		this.recognPicUrl = recognPicUrl;
	}

	public String getDisplayPicUrl() {
		return displayPicUrl;
	}

	public void setDisplayPicUrl(String displayPicUrl) {
		this.displayPicUrl = displayPicUrl;
	}

	public boolean isDefaultVoice() {
		return isDefaultVoice;
	}

	public void setDefaultVoice(boolean isDefaultVoice) {
		this.isDefaultVoice = isDefaultVoice;
	}

	public boolean isDefaultText() {
		return isDefaultText;
	}

	public void setDefaultText(boolean isDefaultText) {
		this.isDefaultText = isDefaultText;
	}
	
	/**
	 * 是否表示一个默认的ar内容实体，即表示其内容文件并不存在服务端
	 * @return
	 */
	public boolean isDefaultContent(){
		return this.isDefaultText && this.isDefaultVoice && this.contentUrl == null;
	}

	
}
